<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户注册</title>
<style>
table {
	border-style: solid;
	border-color: #00F;
	border-width: 1px;
}
</style>
<script src="./Calendar3.js"></script>
<script src="./checkRegister.js"></script>
</head>
<body>
	<h1 align="center">用户注册</h1>
	<form id="form1" name="form1" method="get"
		action="./RegisterProcess" onsubmit="return checkRegister()">
		<table width="350" border="0" align="center">
			<tr>
				<td width="107" height="30" align="right">用户名</td>
				<td width="233" height="30" align="left"><input type="text"
					name="username" id="username" /></td>
			</tr>
			<tr>
				<td height="30" align="right">密码</td>
				<td height="30" align="left"><input type="password"
					name="passwd" id="passwd" /></td>
			</tr>
			<tr>
				<td height="30" align="right">确认密码</td>
				<td height="30" align="left"><input type="password"
					name="passwdconfirm" id="passwdconfirm" /></td>
			</tr>
			<tr>
				<td height="30" align="right">性别</td>
				<td height="30" align="left"><input type="radio" name="gender"
					id="gender1" value="男" checked="checked" /> 男 <input type="radio"
					name="gender" id="gender2" value="女" /> 女</td>
			</tr>
			<tr>
				<td height="30" align="right">生日</td>
				<td height="30" align="left"><input type="text" name="birth"
					id="birth" onclick="new Calendar().show(this);" readonly="readonly" />
				</td>
			</tr>
			<tr>
				<td height="30" align="right">电话</td>
				<td height="30" align="left"><input type="text" name="phone"
					id="phone" /></td>
			</tr>
			<tr>
				<td height="30" align="right">地址</td>
				<td height="30" align="left"><input type="text" name="address"
					id="address" /></td>
			</tr>
			<tr align="center">
				<td height="30" colspan="2"><input type="submit" name="button"
					id="button" value="提交" /> <input type="reset" name="button2"
					id="button2" value="清空" /></td>
			</tr>
		</table>
	</form>
	<c:set value = "${param.error }" var="error"></c:set>
	
	<c:if test="${not empty error and error eq 'userexist' }">
		<script>alert('用户名已存在,请重新填写！')</script>
	</c:if>
	
	<c:if test="${not empty error and error eq 'wrong' }">
		<script>alert('抱歉，注册失败，我们已记录错误信息。')</script>
	</c:if>
</body>
</html>